package com.bulk.loop;

import java.util.Arrays;

/**
 * 多层for循环嵌套，如何跳出到指定的层 （跳出指定for循环）
 *
 * @author 散装java
 * @version 1.0.0
 * @date 2022-11-19
 */
@SuppressWarnings("all")
public class ForTest {
    public static void main(String[] args) {
        int[] arr = new int[4];
        li: for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 10; j++) {
                lk: for (int k = 0; k < 10; k++) {
                    for (int l = 0; l < 10; l++) {
                        arr[i] = ++arr[i];
                        continue li;
                    }
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
